package io.file;

import java.io.*;

public class BIODemo {

	public static void main(String[] args) throws IOException, InterruptedException {

		new File("D:\\testBIOFile.txt").deleteOnExit();

		// 写文件
		BufferedWriter writer = new BufferedWriter(new FileWriter("D:\\testBIOFile.txt"));
		writer.write("hello bio file test ~");
		writer.flush();
		writer.close();

		// 读文件
		BufferedReader reader = new BufferedReader(new FileReader("D:\\testBIOFile.txt"));
		String line;
		while ((line = reader.readLine()) != null) {
			System.out.println(line);
		}
		reader.close();
	}
}
